package notwork;

import java.io.IOException;
import java.net.SocketException;
import java.util.HashMap;

public class UdpdicServer extends UdpEchoSever_3{
    HashMap<String,String>hash=new HashMap<>();
    public UdpdicServer(int port) throws SocketException {
        super(port);
        hash.put("苹果","apple");
        hash.put("鸭子","duck");
        hash.put("学生","Student");
        hash.put("老师","teacher");
    }

    @Override
    public String process(String request) {
        return hash.getOrDefault(request,"没有找到词条");
    }

    public static void main(String[] args) throws IOException {
        UdpdicServer server=new UdpdicServer(4565);
        server.start();
    }
}
